import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

const requirecontext = require.context('./modules',true,/\.js$/);
const modules = requirecontext.keys().reduce((modules,filepath)=>{
    let k = filepath.replace(/(.*\/)*([^.]+).*/ig,"$2");
    let value = requirecontext(filepath);
    modules[k] = value.default;
    return modules;
},{});



export default new Vuex.Store({
    modules,
    strict:true
});